package com.anxin.act.model.editor.controller;

import com.anxin.act.model.editor.service.DiagramLayoutService;
import com.anxin.framework.aspectj.lang.annotation.Log;
import com.anxin.framework.aspectj.lang.enums.BusinessType;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;


@RestController

public class DiagramLayoutController extends DiagramLayoutBaseController {

    @Autowired
    DiagramLayoutService diagramLayoutService;


    @GetMapping("/process-instance/{processInstanceId}/highlights")
    public ObjectNode getHighlighted(@PathVariable String processInstanceId) {
        return diagramLayoutService.getHighlighted(processInstanceId);
    }


    @GetMapping("/process-instance/{processInstanceId}/diagram-layout")
    public ObjectNode getDiagramByPid(@PathVariable String processInstanceId) {
        return getDiagramNode(processInstanceId, null);
    }


    @GetMapping("/process-definition/{processDefinitionId}/diagram-layout")
    public ObjectNode getDiagramByPdid(@PathVariable String processDefinitionId) {
        return getDiagramNode(null, processDefinitionId);
    }
}
